package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.model.entity.NewsEntity;
import com.runen.infinitemovement.tool.GlideUtils;
import com.runen.infinitemovement.widget.imageview.RoundedCornersImage;

/**
 * Create by LiaoDuanHong
 * Create on
 */
public class NewsAdapter extends BaseQuickAdapter<NewsEntity.DataBean.InforMationListBean, BaseViewHolder> {
    private Context context;

    public NewsAdapter(Context context) {
        super(R.layout.item_news);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, NewsEntity.DataBean.InforMationListBean inforMationListBean) {
        RoundedCornersImage image = baseViewHolder.findView(R.id.rci_cover);
        TextView tv_title = baseViewHolder.findView(R.id.tv_title);
        TextView tv_looks = baseViewHolder.findView(R.id.tv_looks);

        GlideUtils.loadImage(context, inforMationListBean.cover, image);
        tv_title.setText(inforMationListBean.title);
        tv_looks.setText(inforMationListBean.readNumber + "浏览");
    }
}
